import React ,{useEffect,useState} from "react"
import {useHistory} from "react-router-dom"
import styles from "./SearchDetail.module.scss"
const SearchDetail:React.FC = () => {
    let history = useHistory()
    let [url,setUrl]=useState<string>('')
    useEffect(()=>{
        setUrl((history.location.state as {url:string}).url)
    },[history])
    function goBack(){
        history.goBack()
    }
    return <div className={styles.wrap}>
            <header onClick={goBack}>返回</header>
            <iframe src={url} ></iframe>
    </div>
}
export default SearchDetail
